package io.xccit.order.feign.fallback;
import java.math.BigDecimal;

import io.xccit.model.product.domain.Product;
import io.xccit.order.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

/**
 * @author CH_ywx
 * @version 1.0
 * @create 2025/6/2
 * <p>商品服务兜底返回</p>
 */

@Component
public class ProductClientFallBack implements ProductFeignClient {
    /**
     * 根据id查询商品信息
     *
     * @param id
     * @return
     */
    @Override
    public Product getProductById(Long id) {
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("");
        product.setNum(0);
        return product;
    }
}
